package cn.linjianhui.flink.sample.web.dao.mysql2;

import cn.linjianhui.flink.sample.web.model.OrderAmountDO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;


@Repository
public interface AllOrderAmountDAO {

    @Select("select * from all_order_amount where statistical_date >= #{startDate} and statistical_date <= #{endDate} order by hour")
    @Results(id = "orderAmountResultMap", value = {
            @Result(property = "statisticalDate", column = "statistical_date"),
            @Result(property = "hour", column = "hour"),
            @Result(property = "orderAmount", column = "order_amount")
    })
    List<OrderAmountDO> listOrderAmount(@Param("startDate")String startDate, @Param("endDate")String endDate);
}
